﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MobiMap.Master" AutoEventWireup="true" CodeBehind="ResultEndPoint.aspx.cs" Inherits="MobiMap.Guest.ResultEndPoint" Title="Untitled Page" %>
<asp:Content ID="ctHead" ContentPlaceHolderID="head" runat="server">
    <title>Result End Point</title>
    <script type="text/javascript">
 
        function tabAddressClick()
        {
            document.getElementById('<%=tabAddress.ClientID%>').className = "tab_active";
            document.getElementById('<%=tabService.ClientID%>').className = "tab_normal";
            
            document.getElementById("<%=gvAddressContainer.ClientID%>").style.display = "block";
            document.getElementById("<%=gvServiceContainer.ClientID%>").style.display = "none";
            
            return false;
        }      
              
        function tabServiceClick()
        {
            document.getElementById('<%=tabAddress.ClientID%>').className = "tab_normal";
            document.getElementById('<%=tabService.ClientID%>').className = "tab_active";
            
            document.getElementById("<%=gvServiceContainer.ClientID%>").style.display = "block";
            document.getElementById("<%=gvAddressContainer.ClientID%>").style.display = "none";
            
            return false;
        }        
        
   
    </script>
</asp:Content>

<asp:Content ID="ctMain" ContentPlaceHolderID="mainArea" runat="server">
    
<div class="addressResult_wrapper" id="addrResult" runat="server">

    <div class="addressResult_title">
        <asp:Label ID="lbKeyWord" runat="server" Text="Label"></asp:Label>
    </div>
 
    <div class="tab_wrapper" align="left">
        <label id="tabAddress" class="tab_active" runat="server" onclick="return tabAddressClick();">Address</label>
        <label id="tabService" class="tab_normal" runat="server" onclick="return tabServiceClick();">Service</label>
    </div>
    <div class="tab_line"></div>
    
    <div id="gvAddressContainer" runat="server">
    <asp:GridView ID="gvAddress" runat="server" AutoGenerateColumns="False" 
        CellPadding="0" CellSpacing="0"  GridLines="None" Width="100%" BorderWidth="0" 
        AllowPaging="True" onrowdatabound="gvAddress_RowDataBound" ShowHeader="False" 
        HorizontalAlign="Left" onpageindexchanging="gvAddress_PageIndexChanging">        

        <RowStyle CssClass="evenRow" HorizontalAlign="Left"/>
        <Columns>            
            <asp:TemplateField>
                <ItemTemplate>                    
                    <asp:LinkButton ID="lbtAddress" runat="server" OnClick="lbtAddress_Click" CssClass="linkButton">
                        <div class="rowInfo">
                            <asp:Label Visible="false" id="lbNumber" runat ="server" Text='<%# DataBinder.Eval(Container.DataItem, "HomeNumber") %>'></asp:Label>
                            <asp:Label id="lbArea" runat ="server" Text='<%# DataBinder.Eval(Container.DataItem, "Area") %>'></asp:Label>
                            <asp:Label Visible="false" id="lbLongitude" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Coordinate.Longitude") %>'></asp:Label>
                            <asp:Label Visible="false" id="lbLatitude" runat ="server" Text='<%# DataBinder.Eval(Container.DataItem, "Coordinate.Latitude") %>'></asp:Label>
                        </div>
                    </asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>            
        </Columns>
        <PagerSettings Mode="NextPrevious" NextPageText="Next" 
            PreviousPageText="Previous" />
        <PagerStyle HorizontalAlign="Left" Font-Underline="True" />
        <AlternatingRowStyle CssClass="oddRow"/>
    </asp:GridView>
    </div>
    
    
 
    <div id="gvServiceContainer" runat="server">
    <asp:GridView ID="gvService" runat="server" AutoGenerateColumns="False" 
        CellPadding="0" CellSpacing="0"  GridLines="None" Width="100%" BorderWidth="0" 
        AllowPaging="True" ShowHeader="False"  HorizontalAlign="Left" 
        onpageindexchanging="gvService_PageIndexChanging" Font-Size="12px">

        <RowStyle CssClass="evenRow" HorizontalAlign="Left"/>
        <Columns>            
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:LinkButton ID="lbtService" runat="server" OnClick="lbtService_Click" CssClass="linkButton">
                    <div class="rowInfo">
                        <asp:Label id="lbFullName" runat ="server" Text='<%# DataBinder.Eval(Container.DataItem, "FullName") %>'></asp:Label><br />
                        <asp:Label id="lbAddress" runat ="server" Text='<%# DataBinder.Eval(Container.DataItem, "Address") %>'></asp:Label>                        
                        <asp:Label Visible="false" id="lbLongitude" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "Location.Longitude") %>'></asp:Label>
                        <asp:Label Visible="false" id="lbLatitude" runat ="server" Text='<%# DataBinder.Eval(Container.DataItem, "Location.Latitude") %>'></asp:Label>
                        <asp:Label Visible="false" id="serID" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "ID") %>'></asp:Label>
                    </div>
                    </asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>            
        </Columns>
        <PagerSettings Mode="NextPrevious" NextPageText="Next" 
            PreviousPageText="Previous" />
        <PagerStyle HorizontalAlign="Left" />        
        <AlternatingRowStyle CssClass="oddRow"/>
    </asp:GridView>
    </div>

    
</div>
</asp:Content>